<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8">
    <title>广告添加</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <!-- page specific plugin styles -->
    <script src="__PUBLIC__/admin/js/jquery.min.js"></script>
    <script src="__PUBLIC__/admin/js/lodash.min.js"></script>
    <script src="__PUBLIC__/admin/js/moment.min.js"></script>
    <script src="__PUBLIC__/admin/js/zh-cn.js"></script>
    <script src="__PUBLIC__/admin/js/numeral.min.js"></script>
    <script src="__PUBLIC__/admin/js/toastr.min.js"></script>
    <script src="__PUBLIC__/admin/js/cookies.js"></script>
    <script src="__PUBLIC__/admin/js/knockout-min.js"></script>
    <script src="__PUBLIC__/admin/js/knockout.mapping.min.js"></script>
    <script src="__PUBLIC__/admin/js/bootstrap-datetimepicker.min.js"></script>
    <script src="__PUBLIC__/admin/js/jquery.validate.min.js"></script>
    <script src="__PUBLIC__/admin/js/jquery.validate.unobtrusive.min.js"></script>
    <script src="__PUBLIC__/admin/js/clipboard.min.js"></script>
    <script src="__PUBLIC__/admin/js/select2.min.js"></script>
    <script src="__PUBLIC__/admin/js/admin.js"></script>
    <script>
      moment.locale('zh-cn');
      toastr.options.positionClass = 'toast-bottom-right';
    </script>
    <!-- ace settings handler -->
    <script src="__PUBLIC__/admin/js/ace-extra.min.js"></script>
<link media="all" href="__PUBLIC__/admin/css/index14.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/glyphicons-halflings-regular.css">
</head>
<body class="no-skin">

    <!-- #section:basics/navbar.layout -->
<include file="./Public/gong/title.html" />

    <div class="main-container" id="main-container">
      <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
      </script>

      <div id="sidebar" class="sidebar responsive">
          <script type="text/javascript">
            try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
          </script>

<include file="./Public/gong/list.html" />


          <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
            <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
          </div>

          <script type="text/javascript">
            try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
          </script>
      </div>

      <!-- /section:basics/sidebar -->
      <div class="main-content">


        <div class="breadcrumbs" id="breadcrumbs">
          <script type="text/javascript">
            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
          </script>

          <ul class="breadcrumb">
            <li>
              <i class="ace-icon fa fa-home home-icon"></i>
              <a    href="#">Home</a>
            </li>
            <li class="active">编辑广告</li>
          </ul><!-- /.breadcrumb -->
          
        </div>

        <div class="page-content">
          <div class="page-content-area">
            <div class="row">
              <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->

                <!--/span-->
                <!-- left menu ends -->



<div style="margin-bottom: 30px;">
    <ul class="nav nav-tabs">
        <li class="active"><a >编辑广告</a></li>

    </ul>
</div>
<form id="main-form" class="form-horizontal"   method="POST" action="{:U('update')}" enctype="multipart/form-data">
    <div class="form-group">
        <label class="control-label col-sm-3">广告位</label>
        <div class="col-sm-9">
            <select name="data[site_id]"  style="height:27px;width:41.6667%;line-height:27px;color:#000;outline:none;">
                <!-- <option value="">{$book.}</option> -->
                <option value="">---请选择---</option>
                <volist name="adcate" id="vt">
                    <if condition="$ad['site_id'] eq $vt['site_id']">
                    <option value="{$vt.site_id}" selected="selected">{$vt.name}</option>
                    <else />
                    <option value="{$vt.site_id}" >{$vt.name}</option>
                    </if>
                </volist>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-3">男生/女生</label>
        <div class="col-sm-2">
            男生<input name="data[sex]"   value="1"  <eq name="ad.sex" value="1">checked="true"</eq> type="radio">
            女生<input name="data[sex]"   value="2"  <eq name="ad.sex" value="2">checked="true"</eq> type="radio">
            <p class="help-block help-block-error col-sm-7 col-xs-10" data-valmsg-for="username" data-valmsg-replace="true"></p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-sm-3">广告名称</label>
        <div class="col-sm-9">
            <input name="data[title]" class="col-sm-5 col-xs-10"  value="{$ad.title}" type="text">
            <p class="help-block help-block-error col-sm-7 col-xs-10" data-valmsg-for="username" data-valmsg-replace="true"></p>
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-sm-3">广告链接</label>
        <div class="col-sm-9">
            <input name="data[link_url]" class="col-sm-5 col-xs-10"  value="{$ad.link_url}" type="text">
            <p class="help-block help-block-error col-sm-7 col-xs-10" data-valmsg-for="username" data-valmsg-replace="true"></p>
        </div>
    </div>    
    <div class="form-group">
        <label class="control-label col-sm-3">图片</label>
        <div class="col-sm-9">
            <!--<img src="__PUBLIC__/Uploads/book/{$book.img}" style="width:200px;height:280px;" class="col-sm-4" />-->
            <input type="text" class="col-sm-5 col-xs-10" name="data[photo]" value="{$ad.photo}">
            <p class="help-block help-block-error col-sm-7 col-xs-10" data-valmsg-for="username" data-valmsg-replace="true">在oss上传图片，然后把地址放这</p>    
        </div>
    </div>
    
    <div class="form-group">
        <label class="control-label col-sm-3">类型</label>
        <div class="col-sm-9">
            <label class="radio-inline">
                <input type="radio"  name="data[type]" value="1" <eq name="ad.type" value="1">checked="true"</eq> >书城
            </label>
            <label class="radio-inline">
                <input type="radio"  name="data[type]"value="2" <eq name="ad.type" value="2">checked="true"</eq>>h5
            </label>
            <label class="radio-inline">
                <input type="radio"  name="data[type]" value="3" <eq name="ad.type" value="3">checked="true"</eq>>空
            </label>
        </div>
    </div>
    


    <div class="clearfix form-actions">
        <div class="col-md-offset-3 col-md-9">
             <input type="hidden" name="data[ad_id]" value="{$ad.ad_id}" />
            <button type="submit" class="btn btn-info" data-bind="click: submit, disable: submitting">保存</button>
        </div>
    </div>
</form>

                                <!-- PAGE CONTENT ENDS -->
</div><!-- /.col -->
</div><!-- /.row -->
</div><!-- /.page-content-area -->
</div><!-- /.page-content -->
</div><!-- /.main-content -->

</div>
<!-- /.main-container -->

        <!-- basic scripts -->

       <!--  <script type="text/javascript">
            if('ontouchstart' in document.documentElement) document.write("<script src='http://novel.818tu.com/static/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
        </script> -->
        <script src="__PUBLIC__/admin/js/bootstrap.min.js"></script>
        <script src="__PUBLIC__/admin/js/jquery.webui-popover.min.js"></script>
        <script src="__PUBLIC__/admin/js/jquery.ui.widget.min.js"></script>
        <script src="__PUBLIC__/admin/js/jquery.fileupload.min.js"></script>

        <!-- page specific plugin scripts -->

        <!-- ace scripts -->
        <script src="__PUBLIC__/admin/js/ace-elements.min.js"></script>
        <script src="__PUBLIC__/admin/js/ace.min.js"></script>

        <!-- inline scripts related to this page -->

        <!-- the following scripts are used in demo only for onpage help and you don't need them -->


       <!--  <script type="text/javascript"> ace.vars['base'] = 'http://novel.818tu.com/static'; </script> -->
        <script src="__PUBLIC__/admin/js/elements.onpage-help.js"></script>
        <script src="__PUBLIC__/admin/js/ace.onpage-help.js"></script>
       <!-- 文本编辑器部分 -->



<script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/ueditor.config.js"></script>

<script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/ueditor.all.min.js"> </script>



<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->



<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->



<script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/lang/zh-cn/zh-cn.js"></script>

<script type="text/javascript">







    //实例化编辑器



    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例



    var ue = UE.getEditor('editor');











    function isFocus(e){



        alert(UE.getEditor('editor').isFocus());



        UE.dom.domUtils.preventDefault(e)



    }



    function setblur(e){



        UE.getEditor('editor').blur();



        UE.dom.domUtils.preventDefault(e)



    }



    function insertHtml() {



        var value = prompt('插入html代码', '');



        UE.getEditor('editor').execCommand('insertHtml', value)



    }



    function createEditor() {



        enableBtn();



        UE.getEditor('editor');



    }



    function getAllHtml() {



        alert(UE.getEditor('editor').getAllHtml())



    }



    function getContent() {



        var arr = [];



        arr.push("使用editor.getContent()方法可以获得编辑器的内容");



        arr.push("内容为：");



        arr.push(UE.getEditor('editor').getContent());



        alert(arr.join("\n"));



    }



    function getPlainTxt() {



        var arr = [];



        arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容");



        arr.push("内容为：");



        arr.push(UE.getEditor('editor').getPlainTxt());



        alert(arr.join('\n'))



    }



    function setContent(isAppendTo) {



        var arr = [];



        arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容");



        UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo);



        alert(arr.join("\n"));



    }



    function setDisabled() {



        UE.getEditor('editor').setDisabled('fullscreen');



        disableBtn("enable");



    }







    function setEnabled() {



        UE.getEditor('editor').setEnabled();



        enableBtn();



    }







    function getText() {



        //当你点击按钮时编辑区域已经失去了焦点，如果直接用getText将不会得到内容，所以要在选回来，然后取得内容



        var range = UE.getEditor('editor').selection.getRange();



        range.select();



        var txt = UE.getEditor('editor').selection.getText();



        alert(txt)



    }







    function getContentTxt() {



        var arr = [];



        arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");



        arr.push("编辑器的纯文本内容为：");



        arr.push(UE.getEditor('editor').getContentTxt());



        alert(arr.join("\n"));



    }



    function hasContent() {



        var arr = [];



        arr.push("使用editor.hasContents()方法判断编辑器里是否有内容");



        arr.push("判断结果为：");



        arr.push(UE.getEditor('editor').hasContents());



        alert(arr.join("\n"));



    }



    function setFocus() {



        UE.getEditor('editor').focus();



    }



    function deleteEditor() {



        disableBtn();



        UE.getEditor('editor').destroy();



    }



    function disableBtn(str) {



        var div = document.getElementById('btns');



        var btns = UE.dom.domUtils.getElementsByTagName(div, "button");



        for (var i = 0, btn; btn = btns[i++];) {



            if (btn.id == str) {



                UE.dom.domUtils.removeAttributes(btn, ["disabled"]);



            } else {



                btn.setAttribute("disabled", "true");



            }



        }



    }



    function enableBtn() {



        var div = document.getElementById('btns');



        var btns = UE.dom.domUtils.getElementsByTagName(div, "button");



        for (var i = 0, btn; btn = btns[i++];) {



            UE.dom.domUtils.removeAttributes(btn, ["disabled"]);



        }



    }







    function getLocalData () {



        alert(UE.getEditor('editor').execCommand( "getlocaldata" ));



    }







    function clearLocalData () {



        UE.getEditor('editor').execCommand( "clearlocaldata" );



        alert("已清空草稿箱")



    }

</script>

</body>
</html>
